 vector<vector<int>> matrixReshape(vector<vector<int>>& mat, int r, int c) {
        int m=mat.size();
        int n=mat[0].size();
        if(m*n!=r*c)
            return mat;
        vector<vector<int>> newarr(r,vector<int>(c));
        int t=0;
        for(int i=0;i<m;i++)
            for(int j=0;j<n;j++){
                newarr[t/c][t%c]=mat[i][j];
                t++;
            }
        return newarr;
 }
